﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using MonoGame;
using Microsoft.Xna.Framework;

namespace TunnelsOfDeath.Objects
{
    class Explosion : Sprite
    {

        protected int lifetime = 8;

        public Explosion(
            int _textureID,
            Dictionary<Direction, Vector2> _animationTable,
            Dictionary<Direction,int> _animationFrames,
            ObjectType _type,
            Vector2 _position,
            double _dealy): base (_textureID,_animationTable,_animationFrames,_type,_position,_dealy)
        {
            
        }

        public override void UpdatePosition(double _tag)
        {

            if (!CheckTag(_tag))
            {
                lifetime--;

                if (lifetime <0)
                {
                    WakeUpNeighbours();
                    Globals.ObjectManager.UnregisterObject(this);
                }
            }
        }



    }
}
